CentOS 6
Sponsored Link

MRTG : Get CPU Load Average
2015/01/25
 
Configure MRTG to display CPU Load Average rate.
[1] Configure MRTG.
[root@dlp ~]#
vi /etc/mrtg/mrtg.cfg
# add follows to the end (replace the "Serverworld" to your comunity name)

Target[CPU]: .1.3.6.1.4.1.2021.10.1.5.1&.1.3.6.1.4.1.2021.10.1.5.2:Serverworld@127.0.0.1
MaxBytes[CPU]: 100
Unscaled[CPU]: dwmy
Options[CPU]: gauge, growright, nopercent
YLegend[CPU]: Load Average
ShortLegend[CPU]: (%)
LegendI[CPU]: Load Average 1 min
LegendO[CPU]: Load Average 5 min
Legend1[CPU]: Load Average 1 min
Legend2[CPU]: Load Average 5 min
Title[CPU]: CPU Load Average
PageTop[CPU]: <h1>CPU Load Average</h1>

# execute mrtg 3 times (display warnings until 3 times)

[root@dlp ~]#
for (( i=1 ; i <= 3 ; i++ )); do env LANG=C mrtg /etc/mrtg/mrtg.cfg; done

2015-01-25 22:04:24, Rateup WARNING: /usr/bin/rateup could not read the primary log file for cpu
2015-01-25 22:04:24, Rateup WARNING: /usr/bin/rateup The backup log file for cpu was invalid as well
2015-01-25 22:04:24, Rateup WARNING: /usr/bin/rateup Can't remove cpu.old updating log file
2015-01-25 22:04:24, Rateup WARNING: /usr/bin/rateup Can't rename cpu.log to cpu.old updating log file
2015-01-25 22:04:32, Rateup WARNING: /usr/bin/rateup Can't remove cpu.old updating log file
# generate index file

[root@dlp ~]#
indexmaker --columns=1 /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
[2] Access to the "http://(MRTG hostname or IP address)/mrtg/" from a client with HTTP, then it's possible to see CPU load average rate.
 
Tweet